import request from '@/utils/request'
import { downFile } from '@/utils/request'

/**
 * 工序分页查询
 * @param {查询条件} data
 */
export function listLmProcess(query) {
	return request({
		url: 'craft/lmProcess/list',
		method: 'get',
		params: query,
	})
}

/**
 * 新增工序
 * @param data
 */
export function addLmProcess(data) {
	return request({
		url: 'craft/lmProcess',
		method: 'post',
		data: data,
	})
}
/**
 * 修改工序
 * @param data
 */
export function updateLmProcess(data) {
	return request({
		url: 'craft/lmProcess',
		method: 'PUT',
		data: data,
	})
}
/**
 * 获取工序详情
 * @param {Id}
 */
export function getLmProcess(id) {
	return request({
		url: 'craft/lmProcess/' + id,
		method: 'get'
	})
}

/**
 * 删除工序
 * @param {主键} pid
 */
export function delLmProcess(pid) {
	return request({
		url: 'craft/lmProcess/delete/' + pid,
		method: 'POST'
	})
}
// 导出工序
export async function exportLmProcess(query) {
	await downFile('craft/lmProcess/export', { ...query })
}
